package com.imc.platform.base.common.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.imc.platform.base.common.dao.ICommonPicMapper;
import com.imc.platform.base.common.pojo.TypePic;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/*
 * 类描述：订单信息服务类
 * 开发者：YT
 * 创建日期：2018/10/12 23:01
 */
@Transactional
@Slf4j
@Service
public class CommonPicServiceImpl implements ICommonPicService {

    @Autowired
    ICommonPicMapper iCommonPicMapper;

    /*
     * YT  2018/10/12 23:00
     * 方法描述：分页查询图片库信息
     */
    public PageInfo <TypePic> queryTypePicByMap(int pageNumber, int pageSize, Map <String, String> typePicMap) {
        PageHelper.startPage(pageNumber, pageSize, true);
        PageInfo info = new PageInfo <TypePic>(iCommonPicMapper.queryTypePicByMap(typePicMap));
        return info;
    }

    @Override
    public String lookUrl(String column,String bnId, String imgName, String table_name,String column1,String column2) {
        return iCommonPicMapper.lookUrl(column, bnId, imgName, table_name,column1,column2);
    }

}
